package com.thb.pay.api.payment;


import com.thb.pay.api.payment.fallback.ChannelConfigServiceApiFallbackFactory;
import com.thb.pay.api.payment.vo.req.ChannelConfigPageReq;
import com.thb.pay.api.payment.vo.req.ChannelConfigReq;
import com.thb.pay.api.payment.vo.resp.PayChannelVo;
import com.thb.pay.core.utils.PageResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * <p>
 * 渠道配置信息接口
 * </p>
 *
 * @author lucky
 * @since 2019-10-15
 */
@FeignClient(value = "pay-service", fallbackFactory = ChannelConfigServiceApiFallbackFactory.class)
@RequestMapping("/channelServiceApi")
public interface PayChannelServiceApi {

    @RequestMapping(value = "/findPage", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    PageResult<PayChannelVo> findPage(@RequestBody ChannelConfigPageReq pageReq);

    @RequestMapping(value = "/getById", method = RequestMethod.GET)
    PayChannelVo getById(@RequestParam("id") Long id);


    @RequestMapping(value = "/getByCode", method = RequestMethod.GET)
    PayChannelVo getByCode(@RequestParam("code") String code);

    @RequestMapping(value = "/add", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    void add(@RequestBody ChannelConfigReq channelConfigReq);

    @RequestMapping(value = "/update", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    void update(@RequestBody ChannelConfigReq channelConfigReq);


}
